<head>
	<meta name="layout" content="main" />
	<title>用户列表</title>
</head>

<body>

	<div class="nav">
		<span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
	</div>

	<div class="body">
		<h1>用户列表</h1>
		<g:if test="${flash.message}">
		<div class="message">${flash.message}</div>
		</g:if>
		<div class="list">
			<table>
			<thead>
				<tr>
					<g:sortableColumn property="username" title="登录名" />
                    <th>密码</th>
					<th>积分</th>
                    <th>Email</th>
					<g:sortableColumn property="enabled" title="是否可用" />
					<g:sortableColumn property="vip" title="VIP等级" />
                    <th>注册时间</th>
				</tr>
			</thead>
			<tbody>
			<g:each in="${personList}" status="i" var="person">
				<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
					<td>${person.username?.encodeAsHTML()}</td>
					<td>${person.realPass}</td>
					<td><span id="showValue${person.id}">${person.total}</span> <input type="text" size="2" id="value${person.id}"/> <a href="javascript:" onClick="setValue(${person.id})"> 添加积分 </a></td>
                    <td>${person.email}</td>
                    <input type="hidden" value="${person.id}" id="personId${person.id}"/>
					<td><span id="showEnabled${person.id}">${person.enabled?'开启中':'关闭中'}</span> <a href="javascript:" onClick="setEnabled(${person.id})">${person.enabled?'关闭':'开启'}</a></td>
					<td><span id="showVip${person.id}">${person.vip}</span> <input type="text" size="2" id="vipLevel${person.id}"/> <a href="javascript:" onClick="setVip(${person.id})"> 设置VIP </a></td>
					<td><g:formatDate format="yyyy-MM-dd HH:mm" date="${person.lastTime}"/></td>
 
				</tr>
			</g:each>
			</tbody>
			</table>
		</div>

		<div class="paginateButtons clearfix c">
            <div class="r">	<g:paginate total="${userCount}" /></div>
		</div>

    <g:javascript src="domain/setVip.js" />
</body>
